import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

const requireComponent = require.context( //自动注册基础组件规则 (注意是单层vue组件 多层的建议统一规则)
	'./components/yjr-components',
	false,
	/[a-z]+\.(vue|js)$/
)

requireComponent.keys().forEach(fileName => { //自动注册基础组件
	const componentConfig = requireComponent(fileName)
	Vue.component(
		fileName.substr(2).split('.')[0],
		componentConfig.default || componentConfig
	)
})
import same from './utils/mixins.js'
Vue.mixin(same)
import 'normalize.css/normalize.css' // 初始化样式 排除css bug

import lxcLoading from 'lxc-loading' //加载动画 插件
Vue.use(lxcLoading)

import '@/styles/transition.scss' //过渡样式

import drag from './utils/v-drag.js' //拖动指令
Vue.directive('drag', drag)

import { //dataV按需引入
	borderBox1,
	borderBox8,
	borderBox9,
	borderBox10,
	decoration2,
	decoration9,
	decoration5,
	decoration11
} from '@jiaminghi/data-view'
Vue.use(borderBox1)
Vue.use(borderBox8)
Vue.use(borderBox10)
Vue.use(borderBox9)
Vue.use(decoration2)
Vue.use(decoration9)
Vue.use(decoration5)
Vue.use(decoration11)

import { //elementui按需引入 记得配置.babelrc.js 和下载 babel-plugin-component
	Button,
	Switch
} from 'element-ui';
Vue.use(Button)
Vue.use(Switch)

Vue.config.productionTip = false

new Vue({
	router,
	store,
	render: h => h(App)
}).$mount('#app')
